package manager

import (
	"regexp"
	"strings"
)

var regPrototol = regexp.MustCompile("^[a-zA-Z0-9_-]+?[:][/][/][/]?(.+)")

func TrimPrefixProtocol(url string) string {
	url = strings.TrimSpace(url)
	matches := regPrototol.FindStringSubmatch(url)
	if len(matches) >= 2 {
		return strings.TrimSpace(matches[1])
	}
	return url
}
